home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
doom
/
quake1.zip
/
STINGER2.ZIP
/
STINGER.QC
< prev
next >
Wrap
Text File
|
1996-09-17
|
4KB
|
102 lines
void() StingerElec;
void() W_LaunchStinger;
void(entity inflictor, entity attacker, float rangee, entity ignore) T_RadiusElectrocute;
void() StingerTouch =
{
if (other.takedamage)
{
sound (self, CHAN_WEAPON, "weapons/bounce.wav", 1, ATTN_NORM);
return;
}
sound (self, CHAN_WEAPON, "weapons/bounce.wav", 1, ATTN_NORM);
if (self.velocity == '0 0 0')
self.avelocity = '0 0 0';
};
void() StingerElec =
{
if (self.waterlevel > 0)
{
T_RadiusElectrocute (self, self.owner, 999999, world);
sound (self, CHAN_WEAPON, "misc/power.wav", 1, ATTN_NORM);
remove (self);
return;
}
else
{
return;
}
};
void() W_LaunchStinger =
{
if (self.ammo_cells < 25)
{
return;
}
local entity missile, mpuff;
self.currentammo = self.ammo_cells = self.ammo_cells - 25;
self.punchangle_x = -2;
missile = spawn ();
missile.owner = self;
missile.movetype = MOVETYPE_BOUNCE;
missile.solid = SOLID_BBOX;
missile.classname = "stinger";
makevectors (self.v_angle);
if (self.v_angle_x)
missile.velocity = v_forward*600 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10;
else
{
missile.velocity = aim(self, 10000);
missile.velocity = missile.velocity * 600;
missile.velocity_z = 200;
}
bprint (self.netname);
bprint (" tosses a stinger!\n");
missile.avelocity = '300 300 300';
missile.angles = vectoangles(missile.velocity);
missile.touch = StingerTouch;
missile.nextthink = time + 4;
missile.think = StingerElec;
setmodel (missile, "progs/nbomb.mdl");
setsize (missile, '0 0 0', '0 0 0');
setorigin (missile, self.origin);
};
void(entity inflictor, entity attacker, float rangee, entity ignore) T_RadiusElectrocute =
{
local entity head, timer;
local vector org;
local string st;
head = findradius(inflictor.origin,rangee);
while (head)
{
if (head != ignore)
{
if (head.takedamage)
{
if (head.classname != "player")
{
if(head.flags & FL_ONGROUND)
head.flags = head.flags - FL_ONGROUND;
}
else if (head.waterlevel > 0)
{
T_Damage (head, inflictor, attacker, 9999);
head.super_time = 1;
head.super_damage_finished = time + 2;
return;
}
else
{
centerprint (head, "There's a barbeque in the pool!\n");
return;
}
}
}
head = head.chain;
}
};